﻿using System;
using System.Collections.Generic;

namespace AMC.SubstitutionCache.ViewModel
{
    public class IndexPostViewModel
    {
        public bool DoTransformOnRedirect { get; set; }
        public int DefaultCacheDurationSeconds { get; set; }
        public string ExcludedShapeTypes { get; set; }
    }

    public class IndexViewModel : IndexPostViewModel
    {
        public StatisticsViewModel Statistics { get; set; }
    }

    public class StatisticsViewModel
    {
        public IEnumerable<StatisticsItemViewModel> CacheItems { get; set; }
        public dynamic Pager { get; set; }
    }

    public class StatisticsItemViewModel
    {
        public string ShapeDescription { get; set; }

        public IEnumerable<SubstitutionItemStatsViewModel> Substitutions { get; set; }

        public string Key { get; set; }

        public IEnumerable<string> Urls { get; set; }

        public int MoreUrlCount { get; set; }
    }

    public class SubstitutionItemStatsViewModel
    {
        public string CacheKey { get; set; }

        public DateTime CachedOnUtc { get; set; }

        public DateTime ValidUntilUtc { get; set; }
    }
}